<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="/common/taglib.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<jsp:include page="/common/meta.jsp"></jsp:include>
<jsp:include page="/common/css_js.jsp"></jsp:include>
<title>发帖</title>
</head>
<SCRIPT type=text/javascript>/*<![CDATA[*/
try{document.domain="codejob.net"; }catch(ex){};
function openDialog(url, dialogTitle, width, height) {
	var dialog = showWindow({ url: url, width: width, height: height, title: dialogTitle });
}

function closeDialog() {
	closeWindow();
}

function getCookie(name) {
	var re = new RegExp("(\;|^)[^;]*(" + name + ")\=([^;]*)(;|$)");
	var match = re.exec(document.cookie);
	return match != null ? unescape(match[3]) : null;
}

function displayVisitor() {
	var username = getCookie("UserName");
	if (!username || (/^guest$/i).test(username)) username = "游客";
	if ($("exit")) $("exit").style.display = username == "游客" ? "none" : "";
	if ($("login")) $("login").style.display = username == "游客" ? "" : "none";
	if ($("vName")) $("vName").innerHTML = username;
}

function addEventHandler(target, type, func) {
	if (target.addEventListener)
		target.addEventListener(type, func, false);
	else if (target.attachEvent)
		target.attachEvent("on" + type, func);
	else target["on" + type] = func;
}

addEventHandler(window, "load", function() {
	displayVisitor();
});

function $(id) { return document.getElementById(id); }
/*]]>*/</SCRIPT>


<SCRIPT type=text/javascript src="<%=contextPath%>/js/CsdnScriptWorkshop.js"></SCRIPT>

<SCRIPT type=text/javascript src="<%=contextPath%>/js/sections.js"></SCRIPT>

<SCRIPT type=text/javascript src="<%=contextPath%>/js/CsdnDialog.js"></SCRIPT>
<META content="text/html; charset=utf-8" http-equiv=Content-Type>
<!--link type="text/css" rel="Stylesheet" href="http://c.csdn.net/bbs/f/s/page.css"/-->
<LINK rel=stylesheet type=text/css href="<%=contextPath%>/css/PostTopic.css">
<LINK rel=stylesheet type=text/css href="<%=contextPath%>/css/CsdnUbbEditor.css">
<META name=GENERATOR content="MSHTML 9.00.8112.16421"></HEAD>
<BODY id=bbscsdn_wrap>
<DIV class=nav><A 
href="#"><IMG 
class=logo alt="" src="<%=contextPath%>/images/algothrim/pic_logo.gif"></A> 
<UL class=txt>
  <LI><A href="#" target=_blank>首页</A>| </LI>
  <LI><A href="#" target=_blank>算法</A>| </LI>
  <LI><A href="#" target=_blank>项目交易</A>| </LI>
  <LI><A href="#" target=_blank>工作</A> </LI>
</UL>
<UL style="TEXT-ALIGN: right; WIDTH: 742px; FLOAT: right" class=user>
  <LI>欢迎您：<SPAN><A id=vName href="#">游客</A></SPAN><SPAN 
  style="DISPLAY: none" id=exit>|<A 
  href="#">退出</A></SPAN><SPAN 
  id=login>|<A href="#">登录</A><A 
  href="#">注册</A></SPAN>|<A 
  href="http://community.csdn.net/Help/HelpCenter.htm" target=_blank>帮助</A> 
  <INPUT onblur="if(!this.value)this.value='这里也许就有您要的答案... ';return true;" 
  id=search_key 
  onfocus="if(this.value=='这里也许就有您要的答案... ')this.value='';return true;" 
  onkeyup=GoKeyDown(event); value="这里也许就有您要的答案... " size=25> <INPUT class=btn 
  onclick="Search(event,'');return false;" src="<%=contextPath%>/images/algothrim/search1.gif" 
  type=image></LI></UL></DIV>
<SCRIPT type=text/javascript>
    	function Search(ev, type) {
    		var url = document.getElementById("search_key").value;
    		var searchPage;
    		if (type == "advanced") searchPage = "http://so.csdn.net/advanced_search.aspx";
    		else searchPage = "http://so.csdn.net/bbsSearchResult.aspx";
    		if ((url == "") || (url == "这里也许就有您要的答案")) {
    			if (type == "advanced")
    				url = "http://so.csdn.net/advanced_search.aspx";
    			else
    				url = "http://so.csdn.net/bbs.aspx";
    		}
    		else if (encodeURIComponent) url = searchPage + "?q=" + encodeURIComponent(url);
    		else url = searchPage + "?q=" + escape(url);
    		if (document.all && typeof (document.all) == "object") {
    			var a = document.createElement("A");
    			a.target = "_blank";
    			a.href = url;
    			document.body.appendChild(a);
    			a.click();
    			setTimeout(function() { a.parentNode.removeChild(a); }, 50);
    		}
    		else window.open(url, "_blank");
    	}

    	function GoKeyDown(ev) { if (ev.keyCode == 13) Search(ev, ""); }
    </SCRIPT>

<DIV id=pageContent>
<DIV id=innerContent>
<FORM id=aspnetForm method=post name=aspnetForm 
action="<%=contextPath%>/problem/problem!createProblem.action"><s:token />
<DIV style="DISPLAY: none; COLOR: red" 
id=ctl00_CPH_BaseContent_ValidationSummary1></DIV>
<TABLE class=askfra border=0 cellSpacing=1 cellPadding=0 width=960>
  <TBODY>
  <TR>
    <TH class=atit colSpan=2>发表新话题</TH></TR>
  <TR>
    <TD class=bg>文章标题</TD>
    <TD class=boxtit><INPUT id=ctl00_CPH_BaseContent_tb_Subject class=text 
      name="problem.name" maxLength=30 size=60> <EM>您可以输入<SPAN 
      id=subjectLength>30</SPAN>个字符</EM> </TD></TR>
  <TR>
    <TD style="VERTICAL-ALIGN: top" class=bg>文章内容</TD>
    <TD>
      <DIV style="WIDTH: 99.8%"><TEXTAREA style="WIDTH: 100%; HEIGHT: 290px" id=ctl00_CPH_BaseContent_tb_TopicBody___Editor name="problem.remark"></TEXTAREA>
      <SCRIPT language=javascript type=text/javascript 
      src="<%=contextPath%>/js/CsdnUbbEditor.js"></SCRIPT>

      <SCRIPT type=text/javascript>/*<![CDATA[*/
var ubb = new CsdnUbbEditor("ctl00_CPH_BaseContent_tb_TopicBody___Editor");
ubb.contentLength = 10000;
ubb.helpLink = "#";
ubb.render("fontsize|space|bold|italic|underline|strikethrough|color|code|space|url|email|image|space|left|center|right");
/*]]>*/</SCRIPT>
       </DIV></TD></TR>
  <TR>
    <TD class=bg>选择分类</TD>
    <TD><SELECT id=select_big name="problem.type"></SELECT> <SELECT 
      id=select_small name="problem.subType"></SELECT> <INPUT id=ctl00_CPH_BaseContent_hf_SelectForumId 
      name=ctl00$CPH_BaseContent$hf_SelectForumId 
      value="" type=hidden><EM 
      style="DISPLAY: none" id=em_selectbig>请选择所要发表问题的大分类！</EM> <EM 
      style="DISPLAY: none" id=em_selectsmall>请选择所要发表问题的小分类！</EM> </TD></TR>
<!--  <TR>-->
<!--    <TD class=bg>帖子问题点数</TD>-->
<!--    <TD>给分 <INPUT style="WIDTH: 40px; COLOR: black" -->
<!--      id=ctl00_CPH_BaseContent_tb_Point name=ctl00$CPH_BaseContent$tb_Point -->
<!--      maxLength=1 value=1> <SPAN>(</SPAN><SPAN -->
<!--      id=MinPoint>0</SPAN><SPAN>-</SPAN><SPAN -->
<!--      id=MaxPoint>5</SPAN><SPAN>)</SPAN>-->
<!--	</TD></TR>-->
<!--  <TR>-->
    <TD class=bg></TD>
    <TD>
      <UL class=abtn>
        <LI><INPUT id=ctl00_CPH_BaseContent_bt_Submit class=button name=ctl00$CPH_BaseContent$bt_Submit value=发表帖子 type=submit> 
        </LI>
        <LI><INPUT class=button onclick=buttonReset_Click() value="重 写" type=button> 
        </LI></UL>
      <OL>
        <LI>这里发言，表示您接受了CODEJOB代码工作的 <A 
        href="http://community.csdn.net/Help/UserRule.htm" 
        target=_blank>用户行为准则。</A> 
        <LI>请对您的言行负责，并遵守中华人民共和国有关法律法规,尊重网上道德。 
        <LI>转载文章请注明出自“CODEJOB（www.codejob.net）”。如是商业用途请联系原作者。 
</LI></OL></TD></TR></TBODY></TABLE>
<SCRIPT type=text/javascript>/*<![CDATA[*/
                    	var userPoint = +"220";
                    	var outTotalPoint = (/^(true|yes|on)$/i.test("False"));
                    	$("ctl00_CPH_BaseContent_tb_TopicBody___Editor").style.width = "793px";
						function updateSelcect() {
							if ($("select_big").selectedIndex <= 0) {
								$("em_selectsmall").style.display = "none";
								$("em_selectbig").style.display = "";
							} else if ($("select_small").selectedIndex <= 0) {
								$("em_selectsmall").style.display = "";
								$("em_selectbig").style.display = "none";
							} else {
								$("em_selectsmall").style.display = "none";
								$("em_selectbig").style.display = "none";
							}
							for (var i = 0; i < forums.length; i++) {
								if ($("select_big").value == forums[i].id) {
									$("MinPoint").innerHTML = forums[i].non ? 0 : 20;
									for (var j = 0; j < forums[i].childs.length; j++) {
										if ($("select_small").value == forums[i].childs[j].id) {
											$("MinPoint").innerHTML = forums[i].childs[j].non ? 0 : 20;
											if (!outTotalPoint && !forums[i].childs[j].non && userPoint < 20)
												alert("请注意：您没有足够的可用分在技术区发帖。");
											outTotalPoint = false;
											break;
										}
									}
									break;
								}
							}
						}
						
						setAllForumSelect($("select_big"), $("select_small"), $("ctl00_CPH_BaseContent_hf_SelectForumId").value);
						updateSelcect();
						eval('var ForumHighPoints = {}');
						addEventHandler($("select_big"), "change", function(sender) {
							$("ctl00_CPH_BaseContent_hf_SelectForumId").value = $("select_big").value;
							if (ForumHighPoints[$("select_big").value.toLowerCase()]) {
								$("MaxPoint").innerHTML = ForumHighPoints[$("select_big").value.toLowerCase()];
							} else $("MaxPoint").innerHTML = Math.min(100, parseInt("100"));
							updateSelcect();
						});
						addEventHandler($("select_small"), "change", function(sender) {
							$("ctl00_CPH_BaseContent_hf_SelectForumId").value = $("select_small").value;
							updateSelcect();
						});
                        $("ctl00_CPH_BaseContent_bt_Submit").onclick = function() {
                            setTimeout(function() {
                                var btn = $("ctl00_CPH_BaseContent_bt_Submit");
                                btn.disabled = true;
                                setTimeout(function(){btn.disabled=false}, 10000);
                            },10);
                        }
                        var FormElements = [
							$("ctl00_CPH_BaseContent_tb_Subject")
							,$("ctl00_CPH_BaseContent_tb_TopicBody___Editor")
							,$("ctl00_CPH_BaseContent_tb_Point")
							,$("ctl00_CPH_BaseContent_tb_Point")
						];
                        var topicSubject = $("ctl00_CPH_BaseContent_tb_Subject");
                        
						function buttonReset_Click() {
							topicSubject.value = "";
							$("subjectLength").innerHTML = topicSubject.maxLength - topicSubject.value.length;
							$("relationList").innerHTML = "";
							$("ctl00_CPH_BaseContent_tb_TopicBody___Editor").value = "";
						}
						topicSubject.onkeyup = function()
						{
							$("subjectLength").innerHTML = this.maxLength - this.value.length;
							//keypress(this);
						}
						var userName = "Louis85";
						var notCheckOutTopics = +"0";
						var checkOutTopicCount = +"0";
						var PostTopicCount = +"0";
						var DeleteTopicCount = +"0";
						var expireTopicCount = +"0";
						if (/^(true|yes|on)$/i.test("False")) {
							setTimeout(function() {
								openDialog("NotCheckOutTopicsInf2.aspx?un=" + userName, '提示', 400, 150);
							}, 500);
						}
						else
						{
							setTimeout(function() {
								if (notCheckOutTopics > 0 && expireTopicCount > 0) {
									var percent = (Math.min((checkOutTopicCount / Math.abs(PostTopicCount - DeleteTopicCount)) * 100, 99.87)).toFixed(2);
									openDialog("NotCheckOutTopicsInf.aspx?un=" + userName + "&percent=" + percent + "&number=" + notCheckOutTopics, '结帖信息', 430, 300);
								}
							}, 500);
						}
						var loadPlugin = function() {
							if (typeof CsdnScriptPlugins == "undefined") {
								callScript("../ui/scripts/Csdn/Plugin/CsdnScriptPlugins.js?version=2008112706", function() {
									if (typeof CsdnDialog != "undefined" && typeof CsdnScriptPlugins != "undefined")
									CsdnScriptWorkshop.initialize();
								});
							}
						};
						if ((/(msie)\s*(\d+(\.\d+)?)/i).exec(navigator.userAgent))
							setTimeout(loadPlugin, 500);
						else loadPlugin();
						/*]]>*/</SCRIPT>

<SCRIPT type=text/javascript>
//<![CDATA[
var Page_ValidationSummaries =  new Array(document.getElementById("ctl00_CPH_BaseContent_ValidationSummary1"));
//]]>
</SCRIPT>
</FORM></DIV></DIV>
 </BODY></HTML>
